package app.species.ANN;

import java.util.StringTokenizer;

public class SomaGene extends Gene{

	public static final int BIAS = 0;
	public static final int INPUT = 1;
	public static final int HIDDEN = 2;
	public static final int OUTPUT = 3;
	public static final int MEMORY = 4;

	public static final int MAX_INPUT_USAGE_ID = 25;
	public static final int MAX_OUTPUT_USAGE_ID = 4;
	
	private int type;
	private int usageID;

	public SomaGene(int id, int type){
		this(id,type,0);
	}
	public SomaGene(int id, int type, int usageID){
		super(id);
		this.type = type;
		this.usageID = usageID;
	}

	public static SomaGene makeGeneFromString(String str){

		StringTokenizer tokenizer = new StringTokenizer(str);
		int i, t,u;

		tokenizer.nextToken();
		i = Integer.parseInt(tokenizer.nextToken());

		tokenizer.nextToken();
		t = Integer.parseInt(tokenizer.nextToken());

		tokenizer.nextToken();
		u = Integer.parseInt(tokenizer.nextToken());

		return new SomaGene(i, t,u);

	}
	
	public int getUsageID(){
		return usageID;
	}

	public int getType(){
		return this.type;
	}

	public String toString(){

		return "ID: " + this.getID() + " Type: " + this.type + " UsageID: " + usageID;

	}

	private static final long serialVersionUID = -748017728528891409L;
}
